var img;
var interval;
var cur;
var changePos = function() {
	var diff = 200 + document.body.scrollTop - cur;
	cur = diff*0.3 + cur;
	img.style.top = cur;
};

$(document).ready( function() {
	$("body").append("<img id=\"kefuicon\" src=\"images/kefu.gif\"></img>");
	$("#kefuicon").css("position", "absolute");
	$("#kefuicon").css("width", "100");
	$("#kefuicon").css("right", "0");
	$("#kefuicon").attr("z-index", "100");
	$("#kefuicon").css("cursor", "pointer");
	$("#kefuicon").click(function(){
		window.open ("customerChat.jsp");
	});

	img = document.getElementById("kefuicon");
	img.style.top = 200;
	cur = 200;
	interval = setInterval('changePos()', 50);
});